﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="userOperate.aspx.cs" Inherits="GDIT.page.manage.user.userOperate" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>

<%@ Register assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>用户帐号管理</title>
    <link href="../../../css/m_userOperate.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div class="all">






<div class="users">
    <dx:ASPxGridView ID="ASPxGridView1" runat="server" 
        onpageindexchanged="ASPxGridView1_PageIndexChanged">
        <Columns>
            <%--<dx:GridViewDataComboBoxColumn Caption="发布人" FieldName="Publisher.OID" VisibleIndex="1">
                <PropertiesComboBox ValueType="System.String">
                </PropertiesComboBox>
                <FooterCellStyle ForeColor="#000F00">
                </FooterCellStyle>
            </dx:GridViewDataComboBoxColumn>--%>
            <dx:GridViewDataColumn Caption='用户部门' FieldName='Department.DepartmentName' VisibleIndex="1">
                <FooterCellStyle ForeColor="#f00" />
            </dx:GridViewDataColumn>
            <dx:GridViewDataColumn Caption='用户角色' FieldName='Role.RoleName' VisibleIndex="1">
                <FooterCellStyle ForeColor="#f00" />
            </dx:GridViewDataColumn>
            <dx:GridViewDataColumn Caption='用户密码' FieldName='UserPwd' VisibleIndex="1">
                <FooterCellStyle ForeColor="#f00" />
            </dx:GridViewDataColumn>
            <dx:GridViewCommandColumn Caption="操 作">
                <DeleteButton Visible="true" Text="删除">
                </DeleteButton>
            </dx:GridViewCommandColumn>
            <dx:GridViewDataTextColumn Caption="用户名" FieldName="UserName" VisibleIndex="0">
            </dx:GridViewDataTextColumn>
        </Columns>
        <SettingsBehavior AllowFocusedRow="True" ConfirmDelete="True" />
        <Settings ShowHeaderFilterButton="True" />
        <SettingsText CommandDelete="确定要删除吗？" />
    </dx:ASPxGridView>

    <br />
    <a href="javascript:void(0);" onclick="btnAdd_click()" class="btnAdd">新建用户</a>

</div>




<!--弹出层开始-->
<div class="hyaline"></div>
<div class="popup">
    <a title="关闭" href="javascript:void(0);" class="close" onclick="ClosePopup();"></a>

    <span class="lblName">用户名：</span>
    <asp:TextBox ID="txtName" runat="server" CssClass="name"></asp:TextBox>

    <span class="lblPwd">密码：</span>
    <asp:TextBox ID="txtPwd" runat="server" CssClass="pwd"></asp:TextBox>


    <asp:DropDownList ID="ddlRole" runat="server" CssClass="role">
    </asp:DropDownList>

    <asp:DropDownList ID="ddlDepartment" runat="server" CssClass="department">
    </asp:DropDownList>


    <asp:LinkButton ID="btnAdd" runat="server" NavigateUrl="javascript:void(0);" CssClass="add" Title="添加" OnClick="btnAdd_OnClick"></asp:LinkButton>
</div>
<!--弹出层结束-->


<script type="text/javascript">
    function Ready() {
        
    }
    Ready();

    function btnAdd_click() {
        GetElementsByClass("hyaline")[0].style.display = "block";
        GetElementsByClass("popup")[0].style.display = "block";
    }

    function ClosePopup() {
        var hyalineNav; //透明层
        var popupNav; //弹出层
        var alls = document.getElementsByTagName("*");
        for (var i = 0; i < alls.length; i++) {
            if (alls[i].className == "hyaline") {
                hyalineNav = alls[i];
            } else if (alls[i].className == "popup") {
                popupNav = alls[i];
            }
        }
        hyalineNav.style.display = "none";
        popupNav.style.display = "none";
    }

    function GetElementsByClass(className) {
        var events = new Array();
        var allEvents = document.getElementsByTagName("*");
        for (var i = 0; i < allEvents.length; i++) {
            var classNames = allEvents[i].className.split(" ");
            for (var j = 0; j < classNames.length; j++) {
                if (classNames[j] == className) {
                    events[events.length] = allEvents[i];
                }
            }
        }
        return events;
    }
</script>




</div>
</form>
</body>
</html>
